import service from "../utils/request";

// 用户-注册
export function user_register(payload = {}) {
    return service.post('/user/register', payload )
}

// 用户-登录
export function user_login(payload = {}) {
    return service.post('/user/login', payload )
}

// 轮播图
export function index_banner(payload = {}) {
    return service.get('/index/banner', { params: payload })
}

// 首页商品导航
export function index_nav(payload = {}) {
    return service.get('/index/nav', { params: payload })
}

// 推荐列表
export function index_goodlist(payload = {}) {
    return service.get('/index/goodlist', { params: payload })
}

// 一级分类
export function category_list(payload = {}) {
    return service.get('/category/list', { params: payload })
}
// 二级分类
export function category_subcate(payload = {}) {
    return service.get('/category/subcate', { params: payload })
}

// 所有商品-分类搜索
export function good_list(payload = {}) {
    return service.get('/good/list', { params: payload })
}

// 所有商品-按关键字搜索
export function good_search(payload = {}) {
    return service.get('/good/search', { params: payload })
}

// 所有商品-热门搜索
export function good_hotsearch(payload = {}) {
    return service.get('/good/hotsearch', { params: payload })
}

// 商品详情页
export function good_goodinfo(payload = {}) {
    return service.get('/good/goodinfo', { params: payload })
}


// 收藏列表
export function good_favlist(payload = {}) {
    return service.get('/good/favlist', { params: payload })
}
// 商品-收藏
export function good_fav(payload = {}) {
    return service.post('/good/fav', payload )
}
// 取消收藏
export function good_unfav(data = {}) {
    return service.post('/good/unfav', data )
}



// 购物车-列表
export function shopcart_list(payload = {}) {
    return service.get('/shopcart/list', { params: payload })
}
// 购物车-清空
export function shopcart_clear(data = {}) {
    return service.post('/shopcart/clear', data )
}
// 购物车-数量+1
export function shopcart_add(data = {}) {
    return service.post('/shopcart/add', data )
}
// 购物车-数量-1
export function shopcart_sub(data = {}) {
    return service.post('/shopcart/sub', data )
}
